package com.jinlia.show.modules.base.system.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.jinlia.show.common.core.entity.BaseEntity;
import com.jinlia.show.modules.base.config.DynamicSchemaConfig;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;

@Data
@TableName(value = "erp_member_card", schema = DynamicSchemaConfig.schema_system)
public class MemberCard extends BaseEntity {
    @TableId()
    private Long id;
    /**
     * 会员类型ID
     */
    private Long typeId;
    /**
     * 姓名
     */
    private String name;
    /**
     * 性别 m 男，w:nv
     */
    private String sex;
    /**
     * 出生日期
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate birthDate;
    /**
     * 手机号码
     */
    private String mobile;
    /**
     * 累计积分
     */
    private Integer totalScore;
    /**
     * 可用积分
     */
    private Integer availableScore;
    /**
     * 余额
     */
    private BigDecimal balance;
    /**
     * 消费次数
     */
    private Integer consumedTimes;
}
